package com.atdel.demo15;


/**
 * @BelongsProject: java_study
 * @BelongsPackage: com.atdel.demo15
 * @Author: Del
 * @CreateTime: 2025-03-17  10:01
 * @Description: TODO
 * @Version: 1.0
 */
public class Student {
    private String name;
    private int age;

    public Student() {
        System.out.println("Student()");
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void study(){
        System.out.println(name + "在study");
    }

    private void sleep(){
        System.out.println(name + "在sleep");
    }
    // 私有方法
    private void nation(String nation){
        System.out.println(name + "的民族是" + nation);
    }
    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
